home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 2 / Meeting Pearls Vol. II (1995)(GTI - Schatztruhe)[!].iso / Pearls / gfx / pbm / source / jpegV5.lha / jpegV5 / src / install.doc < prev    next >
Text File  |  1994-12-23  |  35KB  |  746 lines

  1. INSTALLATION INSTRUCTIONS for the Independent JPEG Group's JPEG software
  2.  
  3. Copyright (C) 1991-1994, Thomas G. Lane.
  4. This file is part of the Independent JPEG Group's software.
  5. For conditions of distribution and use, see the accompanying README file.
  6.  
  7.  
  8. This file explains how to configure and install the IJG software.  We have
  9. tried to make this software extremely portable and flexible, so that it can be
  10. adapted to almost any environment.  The downside of this decision is that the
  11. installation process is complicated.  We have provided shortcuts to simplify
  12. the task on common systems.  But in any case, you will need at least a little
  13. familiarity with C programming and program build procedures for your system.
  14.  
  15. If you are only using this software as part of a larger program, the larger
  16. program's installation procedure may take care of configuring the IJG code.
  17. For example, Ghostscript's installation script will configure the IJG code.
  18. You don't need to read this file if you just want to compile Ghostscript.
  19.  
  20. If you are on a Unix machine, you may not need to read this file at all.
  21. Try doing
  22.     ./configure
  23.     make
  24.     make test
  25. If that doesn't complain, do
  26.     make install
  27. (better do "make -n install" first to see if the makefile will put the files
  28. where you want them).  Read further if you run into snags or want to customize
  29. the code for your system.
  30.  
  31.  
  32. TABLE OF CONTENTS
  33. -----------------
  34.  
  35. Before you start
  36. Configuring the software:
  37.     using the automatic "configure" script
  38.     using one of the supplied jconfig and makefile files
  39.     by hand
  40. Building the software
  41. Testing the software
  42. Installing the software
  43. Optional stuff
  44. Optimization
  45. Hints for specific systems
  46.  
  47.  
  48. BEFORE YOU START
  49. ================
  50.  
  51. Before installing the software you must unpack the distributed source code.
  52. Since you are reading this file, you have probably already succeeded in this
  53. task.  However, there is a potential for error if you needed to convert the
  54. files to the local standard text file format (for example, if you are on
  55. MS-DOS you may have converted LF end-of-line to CR/LF).  You must apply
  56. such conversion to all the files EXCEPT those whose names begin with "test".
  57. The test files contain binary data; if you change them in any way then the
  58. self-test will give bad results.
  59.  
  60. Please check the last section of this file to see if there are hints for the
  61. specific machine or compiler you are using.
  62.  
  63.  
  64. CONFIGURING THE SOFTWARE
  65. ========================
  66.  
  67. To configure the IJG code for your system, you need to create two files:
  68.   * jconfig.h: contains values for system-dependent #define symbols.
  69.   * Makefile: controls the compilation process.
  70. (On a non-Unix machine, you may create "project files" or some other
  71. substitute for a Makefile.  jconfig.h is needed in any environment.)
  72.  
  73. We provide three different ways to generate these files:
  74.   * On a Unix system, you can just run the "configure" script.
  75.   * We provide sample jconfig files and makefiles for popular machines;
  76.     if your machine matches one of the samples, just copy the right sample
  77.     files to jconfig.h and Makefile.
  78.   * If all else fails, read the instructions below and make your own files.
  79.  
  80.  
  81. Configuring the software using the automatic "configure" script
  82. ---------------------------------------------------------------
  83.  
  84. If you are on a Unix machine, you can just type
  85.     ./configure
  86. and let the configure script construct appropriate configuration files.
  87. If you're using "csh" on an old version of System V, you might need to type
  88.     sh configure
  89. instead to prevent csh from trying to execute configure itself.
  90. Expect configure to run for a few minutes, particularly on slower machines;
  91. it works by compiling a series of test programs.
  92.  
  93. Configure was created with GNU Autoconf and it follows the usual conventions
  94. for GNU configure scripts.  It makes a few assumptions that you may want to
  95. override.  You can do this by providing optional switches to configure:
  96.  
  97. * Configure will use gcc (GNU C compiler) if it's available, otherwise cc.
  98. To force a particular compiler to be selected, use the CC option, for example
  99.     ./configure CC='cc'
  100. The same method can be used to include any unusual compiler switches.
  101. For example, on HP-UX you probably want to say
  102.     ./configure CC='cc -Aa'
  103. to get HP's compiler to run in ANSI mode.
  104.  
  105. * Configure will set up the makefile so that "make install" will install files
  106. into /usr/local/bin, /usr/local/man, etc.  You can specify an installation
  107. prefix other than "/usr/local" by giving configure the option "--prefix=PATH".
  108.  
  109. * If you don't have a lot of swap space, you may need to enable the IJG
  110. software's internal virtual memory mechanism.  To do this, give the option
  111. "--with-maxmem=N" where N is the default maxmemory limit in megabytes.
  112. This is discussed in more detail under "Selecting a memory manager", below.
  113. You probably don't need to worry about this on reasonably-sized Unix machines,
  114. unless you plan to process very large images.
  115.  
  116. Configure has some other features that are useful if you are cross-compiling
  117. or working in a network of multiple machine types; but if you need those
  118. features, you probably already know how to use them.
  119.  
  120.  
  121. Configuring the software using one of the supplied jconfig and makefile files
  122. -----------------------------------------------------------------------------
  123.  
  124. If you have one of these systems, you can just use the provided configuration
  125. files:
  126.  
  127. Makefile    jconfig file    System and/or compiler
  128.  
  129. makefile.manx    jconfig.manx    Amiga, Manx Aztec C
  130. makefile.sas    jconfig.sas    Amiga, SAS C
  131. mak*jpeg.st    jconfig.st    Atari ST/STE/TT, Pure C or Turbo C
  132. makefile.bcc    jconfig.bcc    MS-DOS, Borland C (Turbo C)
  133. makefile.dj    jconfig.dj    MS-DOS, DJGPP (Delorie's port of GNU C)
  134. makefile.mc6    jconfig.mc6    MS-DOS, Microsoft C version 6.x and up
  135. makefile.mms    jconfig.vms    Digital VMS, with MMS software
  136. makefile.vms    jconfig.vms    Digital VMS, without MMS software
  137.  
  138. Copy the proper jconfig file to jconfig.h and the makefile to Makefile
  139. (or whatever your system uses as the standard makefile name).  For the
  140. Atari, we provide three project files; see the Atari hints below.
  141.  
  142.  
  143. Configuring the software by hand
  144. --------------------------------
  145.  
  146. First, generate a jconfig.h file.  If you are moderately familiar with C,
  147. the comments in jconfig.doc should be enough information to do this; just
  148. copy jconfig.doc to jconfig.h and edit it appropriately.  Otherwise, you may
  149. prefer to use the ckconfig.c program.  You will need to compile and execute
  150. ckconfig.c by hand --- we hope you know at least enough to do that.
  151. ckconfig.c may not compile the first try (in fact, the whole idea is for it
  152. to fail if anything is going to).  If you get compile errors, fix them by
  153. editing ckconfig.c according to the directions given in ckconfig.c.  Once
  154. you get it to run, it will write a suitable jconfig.h file, and will also
  155. print out some advice about which makefile to use.
  156.  
  157. You may also want to look at the canned jconfig files, if there is one for a
  158. system similar to yours.
  159.  
  160. Second, select a makefile and copy it to Makefile (or whatever your system
  161. uses as the standard makefile name).  The most generic makefiles we provide
  162. are
  163.     makefile.ansi:    if your C compiler supports function prototypes
  164.     makefile.unix:    if not.
  165. (You have function prototypes if ckconfig.c put "#define HAVE_PROTOTYPES"
  166. in jconfig.h.)  You may want to start from one of the other makefiles if
  167. there is one for a system similar to yours.
  168.  
  169. Look over the selected Makefile and adjust options as needed.  In particular
  170. you may want to change the CC and CFLAGS definitions.  For instance, if you
  171. are using GCC, set CC=gcc.  If you had to use any compiler switches to get
  172. ckconfig.c to work, make sure the same switches are in CFLAGS.
  173.  
  174. If you are on a system that doesn't use makefiles, you'll need to set up
  175. project files (or whatever you do use) to compile all the source files and
  176. link them into executable files cjpeg, djpeg, rdjpgcom, and wrjpgcom.  See
  177. the file lists in any of the makefiles to find out which files go into each
  178. program.  Note that the provided makefiles all make a "library" file libjpeg
  179. first, but you don't have to do that if you don't want to; the file lists
  180. identify which source files are actually needed for compression,
  181. decompression, or both.  As a last resort, you can make a batch script that
  182. just compiles everything and links it all together; makefile.vms is an
  183. example of this (it's for VMS systems that have no make-like utility).
  184.  
  185. Here are comments about some specific configuration decisions you'll
  186. need to make:
  187.  
  188. Command line style
  189. ------------------
  190.  
  191. cjpeg and djpeg can use a Unix-like command line style which supports
  192. redirection and piping, like this:
  193.     cjpeg inputfile >outputfile
  194.     cjpeg <inputfile >outputfile
  195.     source program | cjpeg >outputfile
  196. The simpler "two file" command line style is just
  197.     cjpeg inputfile outputfile
  198. You may prefer the two-file style, particularly if you don't have pipes.
  199.  
  200. You MUST use two-file style on any system that doesn't cope well with binary
  201. data fed through stdin/stdout; this is true for some MS-DOS compilers, for
  202. example.  If you're not on a Unix system, it's safest to assume you need
  203. two-file style.  (But if your compiler provides either the Posix-standard
  204. fdopen() library routine or a Microsoft-compatible setmode() routine, you
  205. can safely use the Unix command line style, by defining USE_FDOPEN or
  206. USE_SETMODE respectively.)
  207.  
  208. To use the two-file style, make jconfig.h say "#define TWO_FILE_COMMANDLINE".
  209.  
  210. Selecting a memory manager
  211. --------------------------
  212.  
  213. The IJG code is capable of working on images that are too big to fit in main
  214. memory; data is swapped out to temporary files as necessary.  However, the
  215. code to do this is rather system-dependent.  We provide four different
  216. memory managers:
  217.  
  218. * jmemansi.c    This version uses the ANSI-standard library routine tmpfile(),
  219.         which not all non-ANSI systems have.  On some systems
  220.         tmpfile() may put the temporary file in a non-optimal
  221.         location; if you don't like what it does, use jmemname.c.
  222.  
  223. * jmemname.c    This version creates named temporary files.  For anything
  224.         except a Unix machine, you'll need to configure the
  225.         select_file_name() routine appropriately; see the comments
  226.         near the head of jmemname.c.  If you use this version, define
  227.         NEED_SIGNAL_CATCHER in jconfig.h to make sure the temp files
  228.         are removed if the program is aborted.
  229.  
  230. * jmemnobs.c    (That stands for No Backing Store :-).)  This will compile on
  231.         almost any system, but it assumes you have enough main memory
  232.         or virtual memory to hold the biggest images you work with.
  233.  
  234. * jmemdos.c    This should be used with most 16-bit MS-DOS compilers.
  235.         See the system-specific notes about MS-DOS for more info.
  236.         IMPORTANT: if you use this, define USE_MSDOS_MEMMGR in
  237.         jconfig.h, and include the assembly file jmemdosa.asm in the
  238.         programs.  The supplied makefiles and jconfig files for
  239.         MS-DOS compilers already do both.
  240.  
  241. To use a particular memory manager, change the SYSDEPMEM variable in your
  242. makefile to equal the corresponding object file name (for example, jmemansi.o
  243. or jmemansi.obj for jmemansi.c).
  244.  
  245. If you have plenty of (real or virtual) main memory, just use jmemnobs.c.
  246. "Plenty" means about ten bytes for every pixel in the largest images
  247. you plan to process, so a lot of systems don't meet this criterion.
  248. If yours doesn't, try jmemansi.c first.  If that doesn't compile, you'll have
  249. to use jmemname.c; be sure to adjust select_file_name() for local conditions.
  250. You may also need to change unlink() to remove() in close_backing_store().
  251.  
  252. Except with jmemnobs.c, you need to adjust the DEFAULT_MAX_MEM setting to a
  253. reasonable value for your system (either by adding a #define for
  254. DEFAULT_MAX_MEM to jconfig.h, or by adding a -D switch to the Makefile).
  255. This value limits the amount of data space the program will attempt to
  256. allocate.  Code and static data space isn't counted, so the actual memory
  257. needs for cjpeg or djpeg are typically 100 to 150Kb more than the max-memory
  258. setting.  Larger max-memory settings reduce the amount of I/O needed to
  259. process a large image, but too large a value can result in "insufficient
  260. memory" failures.  On most Unix machines (and other systems with virtual
  261. memory), just set DEFAULT_MAX_MEM to several million and forget it.  At the
  262. other end of the spectrum, for MS-DOS machines you probably can't go much
  263. above 300K to 400K.  (On MS-DOS the value refers to conventional memory only.
  264. Extended/expanded memory is handled separately by jmemdos.c.)
  265.  
  266.  
  267. BUILDING THE SOFTWARE
  268. =====================
  269.  
  270. Now you should be able to compile the software.  Just say "make" (or
  271. whatever's necessary to start the compilation).  Have a cup of coffee.
  272.  
  273. Here are some things that could go wrong:
  274.  
  275. If your compiler complains about undefined structures, you should be able to
  276. shut it up by putting "#define INCOMPLETE_TYPES_BROKEN" in jconfig.h.
  277.  
  278. If you have trouble with missing system include files or inclusion of the
  279. wrong ones, read jinclude.h.  This shouldn't happen if you used configure
  280. or ckconfig.c to set up jconfig.h.
  281.  
  282. There are a fair number of routines that do not use all of their parameters;
  283. some compilers will issue warnings about this, which you can ignore.  There
  284. are also a few configuration checks that may give "unreachable code" warnings.
  285. Any other warning deserves investigation.
  286.  
  287. If you don't have a getenv() library routine, define NO_GETENV.
  288.  
  289. Also see the system-specific hints, below.
  290.  
  291.  
  292. TESTING THE SOFTWARE
  293. ====================
  294.  
  295. As a quick test of functionality we've included a small sample image in
  296. several forms:
  297.     testorig.jpg    Starting point for the djpeg tests.
  298.     testimg.ppm    The output of djpeg testorig.jpg
  299.     testimg.gif    The output of djpeg -gif testorig.jpg
  300.     testimg.jpg    The output of cjpeg testimg.ppm
  301. (The two .jpg files aren't identical since JPEG is lossy.)  If you can
  302. generate duplicates of the testimg.* files then you probably have working
  303. programs.
  304.  
  305. With most of the makefiles, "make test" will perform the necessary
  306. comparisons.
  307.  
  308. If you're using a makefile that doesn't provide the test option, run djpeg
  309. and cjpeg by hand to generate testout.ppm, testout.gif, and testout.jpg,
  310. then compare these to testimg.* with whatever binary file comparison tool
  311. you have.  The files should be bit-for-bit identical.
  312.  
  313. If the programs complain "MAX_ALLOC_CHUNK is wrong, please fix", then you
  314. need to reduce MAX_ALLOC_CHUNK to a value that fits in type size_t.
  315. Try adding "#define MAX_ALLOC_CHUNK 65520L" to jconfig.h.  A less likely
  316. configuration error is "ALIGN_TYPE is wrong, please fix": defining ALIGN_TYPE
  317. as long should take care of that one.
  318.  
  319. If the cjpeg test run fails with "Missing Huffman code table entry", it's a
  320. good bet that you needed to define RIGHT_SHIFT_IS_UNSIGNED.  Go back to the
  321. configuration step and run ckconfig.c.  (This is a good plan for any other
  322. test failure, too.)
  323.  
  324. If you are using Unix (one-file) command line style on a non-Unix system,
  325. it's a good idea to check that binary I/O through stdin/stdout actually
  326. works.  You should get the same results from "djpeg <testorig.jpg >out.ppm"
  327. as from "djpeg -outfile out.ppm testorig.jpg".  Note that the makefiles all
  328. use the latter style and therefore do not exercise stdin/stdout!  If this
  329. check fails, try recompiling cjpeg.c and djpeg.c with USE_SETMODE or
  330. USE_FDOPEN.  If it still doesn't work, better use two-file style.
  331. (rdjpgcom.c and wrjpgcom.c will also need to be recompiled.)
  332.  
  333. If you chose a memory manager other than jmemnobs.c, you should test that
  334. temporary-file usage works.  Try "djpeg -gif -max 0 testorig.jpg" and make
  335. sure its output matches testimg.gif.  If you have any really large images
  336. handy, try compressing them with -optimize and/or decompressing with -gif to
  337. make sure your DEFAULT_MAX_MEM setting is not too large.
  338.  
  339. NOTE: this is far from an exhaustive test of the JPEG software; some modules,
  340. such as 1-pass color quantization, are not exercised at all.  It's just a
  341. quick test to give you some confidence that you haven't missed something
  342. major.
  343.  
  344.  
  345. INSTALLING THE SOFTWARE
  346. =======================
  347.  
  348. Once you're done with the above steps, you can install the software by
  349. copying the executable files (cjpeg, djpeg, rdjpgcom, and wrjpgcom) to
  350. wherever you normally install programs.  On Unix systems, you'll also want
  351. to put the man pages (cjpeg.1, djpeg.1, rdjpgcom.1, wrjpgcom.1) in the
  352. man-page directory.  The canned makefiles don't support this step since
  353. there's such a wide variety of installation procedures on different systems.
  354.  
  355. If you generated a Makefile with the "configure" script, you can just say
  356.     make install
  357. to install the programs and their man pages into the standard places.
  358. (You'll probably need to be root to do this.)  We recommend first saying
  359.     make -n install
  360. to see where configure thought the files should go.  You may need to edit
  361. the Makefile, particularly if your system's conventions for man page
  362. filenames don't match what configure expects.
  363.  
  364. If you want to install the library file libjpeg.a and the include files j*.h
  365. (for use in compiling other programs besides cjpeg/djpeg), then say
  366.     make install-lib
  367.  
  368.  
  369. OPTIONAL STUFF
  370. ==============
  371.  
  372. Progress monitor:
  373.  
  374. If you like, you can #define PROGRESS_REPORT (in jconfig.h) to enable display
  375. of percent-done progress reports.  The routines provided in cjpeg.c/djpeg.c
  376. merely print percentages to stderr, but you can customize them to do
  377. something fancier.
  378.  
  379. Utah RLE file format support:
  380.  
  381. We distribute the software with support for RLE image files (Utah Raster
  382. Toolkit format) disabled, because the RLE support won't compile without the
  383. Utah library.  If you have URT version 3.1 or later, you can enable RLE
  384. support as follows:
  385.     1.  #define RLE_SUPPORTED in jconfig.h.
  386.     2.  Add a -I option to CFLAGS in the Makefile for the directory
  387.         containing the URT .h files (typically the "include"
  388.         subdirectory of the URT distribution).
  389.     3.  Add -L... -lrle to LDLIBS in the Makefile, where ... specifies
  390.         the directory containing the URT "librle.a" file (typically the
  391.         "lib" subdirectory of the URT distribution).
  392.  
  393. Removing code:
  394.  
  395. If you need to make a smaller version of the JPEG software, some optional
  396. functions can be removed at compile time.  See the xxx_SUPPORTED #defines in
  397. jconfig.h and jmorecfg.h.  If at all possible, we recommend that you leave in
  398. decoder support for all valid JPEG files, to ensure that you can read anyone's
  399. output.  Taking out support for image file formats that you don't use is the
  400. most painless way to make the programs smaller.  Another possibility is to
  401. remove some of the DCT methods: in particular, the "IFAST" method may not be
  402. enough faster than the others to be worth keeping on your machine.  (If you
  403. do remove ISLOW or IFAST, be sure to redefine JDCT_DEFAULT or JDCT_FASTEST
  404. to a supported method, by adding a #define in jconfig.h.)
  405.  
  406.  
  407. OPTIMIZATION
  408. ============
  409.  
  410. Unless you own a Cray, you'll probably be interested in making the JPEG
  411. software go as fast as possible.  This section covers some machine-dependent
  412. optimizations you may want to try.  We suggest that before trying any of
  413. this, you first get the basic installation to pass the self-test step.
  414. Repeat the self-test after any optimization to make sure that you haven't
  415. broken anything.
  416.  
  417. The integer DCT routines perform a lot of multiplications.  These
  418. multiplications must yield 32-bit results, but none of their input values
  419. are more than 16 bits wide.  On many machines, notably the 680x0 and 80x86
  420. CPUs, a 16x16=>32 bit multiply instruction is faster than a full 32x32=>32
  421. bit multiply.  Unfortunately there is no portable way to specify such a
  422. multiplication in C, but some compilers can generate one when you use the
  423. right combination of casts.  See the MULTIPLYxxx macro definitions in
  424. jdct.h.  If your compiler makes "int" be 32 bits and "short" be 16 bits,
  425. defining SHORTxSHORT_32 is fairly likely to work.  When experimenting with
  426. alternate definitions, be sure to test not only whether the code still works
  427. (use the self-test), but also whether it is actually faster --- on some
  428. compilers, alternate definitions may compute the right answer, yet be slower
  429. than the default.  Timing cjpeg on a large PPM input file is the best way to
  430. check this, as the DCT will be the largest fraction of the runtime in that
  431. mode.  (Note: some of the distributed compiler-specific jconfig files
  432. already contain #define switches to select appropriate MULTIPLYxxx
  433. definitions.)
  434.  
  435. If your machine has sufficiently fast floating point hardware, you may find
  436. that the float DCT method is faster than the integer DCT methods, even
  437. after tweaking the integer multiply macros.  In that case you may want to
  438. make the float DCT be the default method.  (The only objection to this is
  439. that float DCT results may vary slightly across machines.)  To do that, add
  440. "#define JDCT_DEFAULT JDCT_FLOAT" to jconfig.h.  Even if you don't change
  441. the default, you should redefine JDCT_FASTEST, which is the method selected
  442. by djpeg's -fast switch.  Don't forget to update the documentation files
  443. (usage.doc and/or cjpeg.1, djpeg.1) to agree with what you've done.
  444.  
  445. If access to "short" arrays is slow on your machine, it may be a win to
  446. define type JCOEF as int rather than short.  This will cost a good deal of
  447. memory though, particularly in some multi-pass modes, so don't do it unless
  448. you have memory to burn and short is REALLY slow.
  449.  
  450. If your compiler can compile function calls in-line, make sure the INLINE
  451. macro in jmorecfg.h is defined as the keyword that marks a function
  452. inline-able.  Some compilers have a switch that tells the compiler to inline
  453. any function it thinks is profitable (e.g., -finline-functions for gcc).
  454. Enabling such a switch is likely to make the compiled code bigger but faster.
  455.  
  456. In general, it's worth trying the maximum optimization level of your compiler,
  457. and experimenting with any optional optimizations such as loop unrolling.
  458. (Unfortunately, far too many compilers have optimizer bugs ... be prepared to
  459. back off if the code fails self-test.)  If you do any experimentation along
  460. these lines, please report the optimal settings to jpeg-info@uunet.uu.net so
  461. we can mention them in future releases.  Be sure to specify your machine and
  462. compiler version.
  463.  
  464.  
  465. HINTS FOR SPECIFIC SYSTEMS
  466. ==========================
  467.  
  468. We welcome reports on changes needed for systems not mentioned here.  Submit
  469. 'em to jpeg-info@uunet.uu.net.  Also, if configure or ckconfig.c is wrong
  470. about how to configure the JPEG software for your system, please let us know.
  471.  
  472.  
  473. Acorn RISC OS:
  474.  
  475. (Thanks to Simon Middleton for these hints on compiling with Desktop C.)
  476. After renaming the files according to Acorn conventions, take a copy of
  477. makefile.ansi, change all occurrences of 'libjpeg.a' to 'libjpeg.o' and
  478. change these definitions as indicated:
  479.  
  480. CFLAGS= -throwback -IC: -Wn
  481. LDLIBS=C:o.Stubs
  482. SYSDEPMEM=jmemansi.o
  483. LN=Link
  484. AR=LibFile -c -o
  485.  
  486. Also add a new line '.c.o:; $(cc) $< $(cflags) -c -o $@'.  Remove the
  487. lines '$(RM) libjpeg.o' and '$(AR2) libjpeg.o' and the 'jconfig.h'
  488. dependency section.
  489.  
  490. Copy jconfig.doc to jconfig.h.  Edit jconfig.h to define TWO_FILE_COMMANDLINE
  491. and CHAR_IS_UNSIGNED.
  492.  
  493. Run the makefile using !AMU not !Make.  If you want to use the 'clean' and
  494. 'test' makefile entries then you will have to fiddle with the syntax a bit
  495. and rename the test files.
  496.  
  497.  
  498. Amiga:
  499.  
  500. SAS C 6.50 reportedly is too buggy to compile the IJG code properly.
  501. A patch to update to 6.51 is available from SAS or AmiNet FTP sites.
  502.  
  503.  
  504. Atari ST/STE/TT:
  505.  
  506. Copy the project files makcjpeg.st, makdjpeg.st, and makljpeg.st to cjpeg.prj,
  507. djpeg.prj, and libjpeg.prj respectively.  The project files should work as-is
  508. with Pure C.  For Turbo C, change library filenames "PC..." to "TC..." in
  509. cjpeg.prj and djpeg.prj.  Note that libjpeg.prj selects jmemansi.c as the
  510. recommended memory manager.  You'll probably want to adjust the
  511. DEFAULT_MAX_MEM setting --- you want it to be a couple hundred K less than
  512. your normal free memory.  Put "#define DEFAULT_MAX_MEM nnnn" into jconfig.h
  513. to do this.
  514.  
  515. To use the 68881/68882 coprocessor for the floating point DCT, add the
  516. compiler option "-8" to the project files and replace PCFLTLIB.LIB with
  517. PC881LIB.LIB in cjpeg.prj and djpeg.prj.  Or if you don't have a
  518. coprocessor, you may prefer to remove the float DCT code by undefining
  519. DCT_FLOAT_SUPPORTED in jmorecfg.h (since without a coprocessor, the float
  520. code will be too slow to be useful).  In that case, you can delete
  521. PCFLTLIB.LIB from the project files.
  522.  
  523. Note that you must make libjpeg.lib before making cjpeg.ttp or djpeg.ttp.
  524. You'll have to perform the self-test by hand.
  525.  
  526. We haven't bothered to include project files for rdjpgcom and wrjpgcom.
  527. Those source files should just be compiled by themselves; they don't
  528. depend on the JPEG library.
  529.  
  530. There is a bug in some older versions of the Turbo C library which causes the
  531. space used by temporary files created with "tmpfile()" not to be freed after
  532. an abnormal program exit.  If you check your disk afterwards, you will find
  533. cluster chains that are allocated but not used by a file.  This should not
  534. happen in cjpeg or djpeg, since we enable a signal catcher to explicitly close
  535. temp files before exiting.  But if you use the JPEG library with your own
  536. code, be sure to supply a signal catcher, or else use a different
  537. system-dependent memory manager.
  538.  
  539.  
  540. Cray:
  541.  
  542. Should you be so fortunate as to be running JPEG on a Cray YMP, there is a
  543. compiler bug in old versions of Cray's Standard C (prior to 3.1).  If you
  544. still have an old compiler, you'll need to insert a line reading
  545. "#pragma novector" just before the loop    
  546.     for (i = 1; i <= (int) htbl->bits[l]; i++)
  547.       huffsize[p++] = (char) l;
  548. in fix_huff_tbl (in V5beta1, line 204 of jchuff.c and line 176 of jdhuff.c).
  549. [This bug may or may not still occur with the current IJG code, but it's
  550. probably a dead issue anyway...]
  551.  
  552.  
  553. HP-UX:
  554.  
  555. If you have HP-UX 7.05 or later with the "software development" C compiler,
  556. you should run the compiler in ANSI mode.  If using the configure script,
  557. say
  558.     ./configure CC='cc -Aa'
  559. (or -Ae if you prefer).  If configuring by hand, use makefile.ansi and add
  560. "-Aa" to the CFLAGS line in the makefile.
  561.  
  562. If you have a pre-7.05 system, or if you are using the non-ANSI C compiler
  563. delivered with a minimum HP-UX system, then you must use makefile.unix
  564. (and do NOT add -Aa); or just run configure without the CC option.
  565.  
  566. On HP 9000 series 800 machines, the HP C compiler is buggy in revisions prior
  567. to A.08.07.  If you get complaints about "not a typedef name", you'll have to
  568. use makefile.unix, or run configure without the CC option.
  569.  
  570.  
  571. Macintosh, MPW:
  572.  
  573. We don't directly support MPW in the current release, but Larry Rosenstein
  574. ported an earlier version of the IJG code without very much trouble.  There's
  575. useful notes and conversion scripts in his kit for porting PBMPLUS to MPW.
  576. You can obtain the kit by FTP to ftp.apple.com, files /pub/lsr/pbmplus-port*.
  577.  
  578.  
  579. Macintosh, Metrowerks CodeWarrior:
  580.  
  581. Metrowerks release DR2 has problems with the IJG code; don't use it.  Release
  582. DR3.5 or later should be OK.
  583.  
  584. The command-line-style interface can be used by defining USE_CCOMMAND and
  585. TWO_FILE_COMMANDLINE (see next entry for more details).
  586.  
  587. On 680x0 Macs, Metrowerks defines type "double" as a 10-byte IEEE extended
  588. float.  jmemmgr.c won't like this: it wants sizeof(ALIGN_TYPE) to be a power
  589. of 2.  Add "#define ALIGN_TYPE long" to jconfig.h to eliminate the complaint.
  590.  
  591.  
  592. Macintosh, Think C:
  593.  
  594. The supplied user-interface files (cjpeg.c and djpeg.c) are set up to provide
  595. a Unix-style command line interface.  You can use this interface on the Mac
  596. by means of Think's ccommand() library routine.  However, a much better
  597. Mac-style user interface has been prepared by Jim Brunner.  You can obtain
  598. the additional source code needed for that user interface by FTP to
  599. sumex-aim.stanford.edu, file /info-mac/dev/src/jpeg-convert-c.hqx.  Jim's
  600. documentation also includes more detailed build instructions for Think C.
  601. (Jim is working on updating this code to work with v5 of the IJG library,
  602. but it wasn't ready as of v5 release time.  Should be out before too long.)
  603.  
  604. If you want to build the minimal command line version, proceed as follows.
  605. You'll have to prepare project files for the programs; we don't include any
  606. in the distribution since they are not text files.  Use the file lists in
  607. any of the supplied makefiles as a guide.  Also add the ANSI and Unix C
  608. libraries in a separate segment.  You may need to divide the JPEG files into
  609. more than one segment; we recommend dividing compression and decompression
  610. modules.  Define USE_CCOMMAND in jconfig.h so that the ccommand() routine is
  611. called.  You must also define TWO_FILE_COMMANDLINE because stdin/stdout
  612. don't handle binary data correctly.
  613.  
  614. On 680x0 Macs, Think C defines type "double" as a 12-byte IEEE extended float.
  615. jmemmgr.c won't like this: it wants sizeof(ALIGN_TYPE) to be a power of 2.
  616. Add "#define ALIGN_TYPE long" to jconfig.h to eliminate the complaint.
  617.  
  618.  
  619. MIPS R3000:
  620.  
  621. MIPS's cc version 1.31 has a rather nasty optimization bug.  Don't use -O
  622. if you have that compiler version.  (Use "cc -V" to check the version.)
  623. Note that the R3000 chip is found in workstations from DEC and others.
  624.  
  625.  
  626. MS-DOS, generic comments for 16-bit compilers:
  627.  
  628. The IJG code is designed to be compiled in 80x86 "small" or "medium" memory
  629. models (i.e., data pointers are 16 bits unless explicitly declared "far";
  630. code pointers can be either size).  You may be able to use small model to
  631. compile cjpeg or djpeg by itself, but you will probably have to use medium
  632. model for any larger application.  This won't make much difference in
  633. performance.  You *will* take a noticeable performance hit if you use a
  634. large-data memory model, and you should avoid "huge" model if at all
  635. possible.  Be sure that NEED_FAR_POINTERS is defined in jconfig.h if you use
  636. a small-data memory model; be sure it is NOT defined if you use a large-data
  637. model.  (The supplied makefiles and jconfig files for Borland and Microsoft C
  638. compile in medium model and define NEED_FAR_POINTERS.)
  639.  
  640. The DOS-specific memory manager, jmemdos.c, should be used if possible.
  641. It needs some assembly-code routines which are in jmemdosa.asm; make sure
  642. your makefile assembles that file and includes it in the library.  If you
  643. don't have a suitable assembler, you can get pre-assembled object files for
  644. jmemdosa by FTP from ftp.uu.net: graphics/jpeg/jdosaobj.zip.
  645.  
  646. When using jmemdos.c, jconfig.h must define USE_MSDOS_MEMMGR and must set
  647. MAX_ALLOC_CHUNK to less than 64K (65520L is a typical value).  If your
  648. C library's far-heap malloc() can't allocate blocks that large, reduce
  649. MAX_ALLOC_CHUNK to whatever it can handle.
  650.  
  651. If you can't use jmemdos.c for some reason --- for example, because you
  652. don't have an assembler to assemble jmemdosa.asm --- you'll have to fall
  653. back to jmemansi.c or jmemname.c.  You'll probably still need to set
  654. MAX_ALLOC_CHUNK in jconfig.h, because most DOS C libraries won't malloc()
  655. more than 64K at a time.  IMPORTANT: if you use jmemansi.c or jmemname.c,
  656. you will have to compile in a large-data memory model in order to get the
  657. right stdio library.  Too bad.
  658.  
  659. wrjpgcom needs to be compiled in large model, because it malloc()s a 64KB
  660. work area to hold the comment text.  If your C library's malloc can't
  661. handle that, reduce MAX_COM_LENGTH as necessary in wrjpgcom.c.
  662.  
  663. Most MS-DOS compilers treat stdin/stdout as text files, so you must use
  664. two-file command line style.  But if your compiler has either fdopen() or
  665. setmode(), you can use one-file style if you like.  To do this, define
  666. USE_SETMODE or USE_FDOPEN so that stdin/stdout will be set to binary mode.
  667. (USE_SETMODE seems to work with more DOS compilers than USE_FDOPEN.)  You
  668. should test that I/O through stdin/stdout produces the same results as I/O
  669. to explicitly named files... the "make test" procedures in the supplied
  670. makefiles do NOT use stdin/stdout.
  671.  
  672.  
  673. MS-DOS, generic comments for 32-bit compilers:
  674.  
  675. None of the above comments about memory models apply if you are using a
  676. 32-bit flat-memory-space environment, such as DJGPP or Watcom C.  (And you
  677. should use one if you have it, as performance will be much better than
  678. 8086-compatible code!)  For flat-memory-space compilers, do NOT define
  679. NEED_FAR_POINTERS, and do NOT use jmemdos.c.  Use jmemnobs.c if the
  680. environment supplies adequate virtual memory, otherwise use jmemansi.c or
  681. jmemname.c.
  682.  
  683. You'll still need to be careful about binary I/O through stdin/stdout.
  684. See the last paragraph of the previous section.
  685.  
  686.  
  687. MS-DOS, Borland C:
  688.  
  689. If you want one-file command line style, just undefine TWO_FILE_COMMANDLINE.
  690. jconfig.bcc includes #define USE_SETMODE.  (fdopen does not work correctly.)
  691.  
  692. Be sure to convert all the source files to DOS text format (CR/LF newlines).
  693. Although Borland C will often work OK with unmodified Unix (LF newlines)
  694. source files, sometimes it will give bogus compile errors.
  695. "Illegal character '#'" is the most common such error.
  696.  
  697.  
  698. MS-DOS, DJGPP:
  699.  
  700. Use a recent version of DJGPP (1.11 or better).  If you prefer two-file
  701. command line style, change the supplied jconfig.dj to define
  702. TWO_FILE_COMMANDLINE.  makefile.dj is set up to generate only COFF files
  703. (cjpeg, djpeg, etc) when you say make.  After testing, say "make exe" to
  704. make executables with stub.exe, or "make standalone" if you want executables
  705. that include go32.  You will probably need to tweak the makefile's pointer to
  706. go32.exe to do "make standalone".
  707.  
  708.  
  709. MS-DOS, Microsoft C:
  710.  
  711. If you want one-file command line style, just undefine TWO_FILE_COMMANDLINE.
  712. jconfig.mc6 includes #define USE_SETMODE.  (fdopen does not work correctly.)
  713.  
  714. Old versions of MS C fail with an "out of macro expansion space" error
  715. because they can't cope with the macro TRACEMS8 (defined in jerror.h).
  716. If this happens to you, the easiest solution is to change TRACEMS8 to
  717. expand to nothing.  You'll lose the ability to dump out JPEG coefficient
  718. tables with djpeg -debug -debug, but at least you can compile.
  719.  
  720. Original MS C 6.0 is very buggy; it compiles incorrect code unless you turn
  721. off optimization entirely (remove -O from CFLAGS).  6.00A is better, but it
  722. still generates bad code if you enable loop optimizations (-Ol or -Ox).
  723.  
  724. MS C 8.0 reportedly fails to compile jquant1.c if optimization is turned off
  725. (yes, off).
  726.  
  727.  
  728. SGI:
  729.  
  730. Set "AR2= ar -ts" rather than "AR2= ranlib" in the Makefile.  If you are
  731. using configure, you should say
  732.     ./configure RANLIB='ar -ts'
  733.  
  734.  
  735. VMS:
  736.  
  737. On an Alpha/VMS system with MMS, be sure to use the "/Marco=Alpha=1"
  738. qualifier with MMS when building the JPEG package.
  739.  
  740. VAX/VMS v5.5-1 may have problems with the test step of the build procedure
  741. reporting differences when it compares the original and test GIF and JPG
  742. images.  If the error points to the last block of the files, it is most
  743. likely bogus and may be safely ignored.  It seems to be because the files
  744. are Stream_LF and Backup/Compare has difficulty with the (presumably) null
  745. padded files.  This problem was not observed on VAX/VMS v6.1 or AXP/VMS v6.1.
  746.